import time
import unittest
from selenium import webdriver

class Unittest(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Firefox()
        self.driver.implicitly_wait(30)
        self.url = "https://studyvideoh5.zhihuishu.com/stuStudy?recruitAndCourseId=4b5a505d445a4859454a58595e45514750"
        self.driver.maximize_window()
        driver = self.driver
        url = self.url
        driver.get(url)
        driver.find_element_by_css_selector("#qStudentID").click()
        time.sleep(3)
        driver.find_element_by_css_selector("#quickSearch").send_keys("武昌工学院")
        driver.find_element_by_css_selector("#schoolListCode > li:nth-child(1) > b:nth-child(1) > font:nth-child(1)").click()
        driver.find_element_by_css_selector("#clCode").send_keys("193001310129")
        driver.find_element_by_css_selector("#clPassword").send_keys("Wz010430")
        driver.find_element_by_css_selector(".switch-wrap > span:nth-child(4)").click()
        time.sleep(10)

    def tearDown(self):
        self.driver.quit()

    def test_robot(self):
        driver = self.driver
        url = self.url
        driver.find_element_by_css_selector("#playButton").click()
        driver.find_element_by_css_selector("#vjs_container > div.controlsBar > div.speedBox").click()
        driver.find_element_by_css_selector("#vjs_container > div.controlsBar > div.speedBox > div > div.speedTab.speedTab15").click()
        if()
        time.sleep(20)

    # app > div > div.box-content > div.box-right > div.el-scrollbar > div.el-scrollbar__wrap > div > ul:nth-child(1) > div:nth-child(4) > li > span > b
    # app > div > div.box-content > div.box-right > div.el-scrollbar > div.el-scrollbar__wrap > div > ul:nth-child(1) > div:nth-child(5) > li > span > b
    # app > div > div.box-content > div.box-right > div.el-scrollbar > div.el-scrollbar__wrap > div > ul:nth-child(2) > div:nth-child(3) > li > span > b

    if __name__ == "__main__":
        unittest.main()